package com.edais.service.imp;

import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.edais.dao.SecurityDao;
import com.edais.service.SecurityService;

@Service

@Transactional(propagation=Propagation.SUPPORTS,readOnly=true)
public class SecurityServiceImp implements SecurityService {
	private static final Log logger = LogFactory.getLog(SecurityServiceImp.class);

	@Autowired
	private SecurityDao securityDao;


	/**
	 * 获取用户的登录识别码
	 * @param map
	 * @return String
	 * @throws Exception 
	 */
	@Override
	@Transactional
	public String getLoginTokenStr(Map<String, String> map) throws Exception {
		
		return securityDao.getLoginTokenStr(map);
	}

	/**
	 * 登录时更新用户的登录识别码
	 * @param map
	 * @return 
	 * @throws Exception 
	 */
//	@Override
//	@Transactional
//	public void updLoginTokenStr(Map<String, Object> map) throws Exception {
//		ssoDao.updLoginTokenStr(map);
//	}

	/**
	 * 退出时更新用户的登录识别码
	 * @param map
	 * @return 
	 * @throws Exception 
	 */
	@Override
	@Transactional
	public void updExitTokenStr(Map<String, String> map) throws Exception {
		securityDao.updExitTokenStr(map);
	}
}
